<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<div class="table-scrollable">
    <table class="table table-striped table-hover table-success">
        <thead>
        <tr>
            <th>序号</th>
            <th>用户名</th>
            <th>真实姓名</th>
            <th>手机号</th>
            <th>年龄</th>
            <th>性别</th>
            <th>注册时间</th>
            <th>地址</th>
            <th>账户状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.result}" var="patient" varStatus="vs">
            <tr>
                <td>${vs.count + page.offset}</td>
                <td>${patient.userName}</td>
                <td>${patient.name}</td>
                <td>${patient.phone}</td>
                <td>${patient.age}</td>
                <%--性别:1、男，0、女，2、保密--%>
                <td>
                    <c:if test="${patient.sex == 0}">女</c:if>
                    <c:if test="${patient.sex == 1}">男</c:if>
                    <c:if test="${patient.sex == 2}">保密</c:if>
                </td>
                <td>
                    <fmt:formatDate value="${patient.createDate}" pattern="yyyy-MM-dd" />
                </td>
                <td>${patient.addressDetail}</td>
                <%--账户状态：1、可使用；0、禁用--%>
                <td>
                    <a href="javascript:;"
                       onclick="changeStatus('/patient/changeStatus?id=${patient.patientId}')">
                        <c:if test="${patient.accountStastus == 0}">启用</c:if>
                        <c:if test="${patient.accountStastus == 1}">禁用</c:if>
                    </a>
                </td>
                <td>
                    <a href="javascript:;" class="btn btn-sm blue"
                       onclick="update('/patient/patient?id=${patient.patientId}')">
                        <i class="fa fa-edit"></i>编辑
                    </a>
                    <a href="javascript:;" class="btn btn-sm red" onclick="show('/patient/show?id=${patient.patientId}')">
                        <i class="fa"></i>查看
                    </a>
                    <a href="javascript:;" class="btn btn-sm red" onclick="del('/patient/delete?id=${patient.patientId}')">
                        <i class="fa fa-trash"></i>删除
                    </a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<div class="pageination-panel">${page}</div>